#!/usr/bin/env node

const fs=require('fs'),
      src=process.argv[2];

fs.watch(src,(evt,file)=>{
  console.log(`{file}:${evt}`);
});
//查看pid:ps -ef | grep 进程
//ctrl+c 或 kill -2 pid
process.on('SIGINT', () => {{
  log('unwitch the directory. Game over after 5 second...');

  setTimeout(() => {
    process.exit();            
  }, 5000);

});

